﻿#ifndef PST_PROPPICKERCALLBACKHANDER_H
#define PST_PROPPICKERCALLBACKHANDER_H

#include <QObject>
#include <QMultiHash>
#include <vtkCommand.h>

class vtkProp;

namespace pst
{
    // 拾取vtkProp,并执行与之关联的qt的槽函数
    class PropPickerCallbackHander :public vtkCommand
    {
        struct ObjectSlot
        {
            QObject* object{ nullptr };
            const char* slot{ nullptr };
        };

    public:
        static PropPickerCallbackHander* New()
        {
            return new PropPickerCallbackHander;
        }

        void addCallbackObjectSlot(vtkProp* propToPick, QObject* obj, const char* slot);

    private:
        void Execute(vtkObject* caller, unsigned long, void*) override;

    private:
        QMultiHash<vtkProp*, ObjectSlot> PropMap{};
    };
}

#endif
